package com.tj.collection.db.dao;

import com.fqgj.common.base.BaseMapper;
import com.tj.collection.db.entity.ClAllocationBatchEntity;
import com.tj.collection.db.entity.business.AllocatedLanguagesVo;

import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2019-09-03
 * Time: 10:18
 */
public interface ClAllocationBatchDao extends BaseMapper<ClAllocationBatchEntity> {

    List<ClAllocationBatchEntity> getAllActiveBatch();

    List<ClAllocationBatchEntity> getAllActiveBatchByStageCode(String stageCode);

    List<ClAllocationBatchEntity> getWaittingRefreshBatch();

    List<ClAllocationBatchEntity> getActiveListByAdminId(Integer adminId);

    List<ClAllocationBatchEntity> getActiveListByAdminIdAndStageCode(Integer adminId, String stageCode);

    List<AllocatedLanguagesVo> getAllocatedStatsOfLanguageByBatchNos(List<String> batchNos);

    /**
     * 把日期小于今天且分配成功的批次 状态改成待刷新
     *
     * @return
     */
    Integer updateBatchSuccessToWaitingRefresh();

    Integer countBatchByDate(Date date);
}
